<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<script src="${ctxWebStatic}/laydate/laydate.js"></script>

<jsp:include page="/WEB-INF/views/layouts/head.jsp"></jsp:include>
<head>
<title>找回密码</title>
<style type="text/css">
em.error {
	height: 18px;
	display: inline-block;
	vertical-align: middle;
	margin-right: 2px;
	margin-left: 20px;
	background: url("${ctxWebStatic}/images/error_img.png") no-repeat 0px
		0px;
	padding-left: 24px;
	color: #d3001e;
	font-size: 16px;
	font-family: "微软雅黑";
}
</style>
<script type="text/javascript">
	//alert("${mobile}");
	var subflag = false;
	var mobile = "${mobile}";
	$(document).ready(function() {
		$("#form").validate({
			rules : {
				password : {
					required : true,
					passwordCheckCheck:true,
					rangelength:[8,20]
				},
				cPassword : {
					required : true,
					equalTo : "#password"
				},
			},

			messages : {
				password : {
					required : '请输入密码',
					rangelength : '请输入8-20个字符,必须包含字母和数字'
				},
				cPassword : {
					required : '请输入确认密码',
					equalTo : '两次输入不一致'
				},
			},
			errorElement : "em",
		});
		jQuery.validator.addMethod("passwordCheckCheck", function(value,element, param) { 
	    	var tel = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/;  
		 	return this.optional(element) || (tel.test(value));  
        }, $.validator.format("请输入8-20个字符,必须包含字母和数字")); 
	});
	
	function sub() {
		if(subflag){
			return;
		}
		var checkFlag = true;

		if (!$("#form").valid()) {
			checkFlag = false;
		}

		if (!checkFlag) {
			return false;
		}
		$("#mobile").val(mobile);
		$("form").submit();
		subflag = true;
	}
	
</script>
</head>
<body>
	<div class="page">
		<jsp:include page="/WEB-INF/views/layouts/top_findPassword.jsp"></jsp:include>
		<!--主体-->
			<div class="main_user_resigt">
				<div class="container">
					<div class="row">
						<div class="step_password clearfix">
							<figure class="step_item">
								<p class="num">1</p>
								<h4>验证手机号码</h4>
							</figure>
							<figure class="step_item">
								<p class="num">2</p>
								<h4>设置新密码</h4>
							</figure>
							<figure class="step_item step_on">
								<p class="num">3</p>
								<h4>设置成功</h4>
							</figure>
						</div>
						<form id="form" action="${ctxWeb}/password/reset" method="post">
							<input type="hidden" id="mobile" name="mobile">
							<div class="form-group clearfix">
							    <label for="firstname" class="col-sm-3 col-xs-4 input_info control-label">
							    	<i class="must_img"></i>新密码：
							    </label>
							    <div class="col-sm-9 col-xs-8 input_left">
							      	<input type="password" id="password" name="password" onpaste="return false" oncontextmenu="return false" oncopy="return false" oncut="return false" class="form-control" placeholder="请输入新密码">
							    </div>
							</div>
							<div class="form-group clearfix">
							    <label for="firstname" class="col-sm-3 col-xs-4 input_info control-label">
							    	<i class="must_img"></i>确认密码：
							    </label>
							    <div class="col-sm-9 col-xs-8 input_left">
							      	<input type="password" id="cPassword" name="cPassword" onpaste="return false" oncontextmenu="return false" oncopy="return false" oncut="return false" class="form-control" placeholder="请再次输入密码">
							    </div>
							</div>
						</form>
						<p class="register_btn next_step col-sm-offset-3 col-xs-offset-4">
							<a href="javascript:void(0)" onclick="sub()">下一步</a>
						</p>
						
					</div>
				</div>
			</div>
			<!--主体结束-->
		<!--foot-->
		<jsp:include page="/WEB-INF/views/layouts/buttom_2.jsp"></jsp:include>
		<!--foot结束-->
	</div>
</body>
</html>
